const express = require('express');
const {findBannerService, updateBannerService} = require("../service/bannerService");
const {formatResponse} = require("../utils/tool");
const {addMessageService, getMessageByPageService, deleteMessageService} = require("../service/messageService");
const router = express.Router();

// 添加留言或者评论
router.post('/', async function (req, res, next) {
    res.send(await addMessageService(req.body))
})

// 获取留言或者评论
router.get('/', async function (req, res, next) {
    res.send(await getMessageByPageService(req.query))
})
// 删除留言或者评论
router.delete('/:id', async function (req, res, next) {
    res.send(await deleteMessageService(req.params.id))
})

module.exports = router;
